// utils.js
export function setupTabBar() {
    const userType = uni.getStorageSync('userType');

    const baseTabBar = [
        {
            "pagePath": userType == 1 ? "/pages/index/index" : "/pages/index/staffIndex",
            "iconPath": "/static/images/tabbar/index.png",
            "selectedIconPath": "/static/images/tabbar/index-on.png",
            "text": "首页"
        },
        {
            "pagePath": "/pages/my/my",
            "iconPath": "/static/images/tabbar/my.png",
            "selectedIconPath": "/static/images/tabbar/my-on.png",
            "text": "我的"
        }
    ];

    if (userType === 1) {
        baseTabBar.splice(1, 0, {
            "pagePath": "/pages/hall/hall",
            "iconPath": "/static/images/tabbar/list.png",
            "selectedIconPath": "/static/images/tabbar/list-on.png",
            "text": "接单大厅"
        });
    }

    return baseTabBar; // 返回生成的 tabBar 数据
}
